class Home():
    def __init__(self, area, addr):
        self.area = area
        self.addr = addr

        self.beds = []

    def append(self, bed):
        bed_area = 0 #总床面积
        for i in self.beds:
            bed_area += i.area

        # 剩余面积
        diff = self.area - bed_area
        if diff > bed.area:
            self.beds.append(bed)
        else:
            print("装不下了")

        bed_area1 = 0  # 总床面积
        for i in self.beds:
            bed_area1 += i.area
        # 剩余面积
        diff1 = self.area - bed_area1
        print("剩余{}".format(diff1))


class Bed():
    def __init__(self, area, brand):
        self.area = area
        self.brand = brand


home = Home(120, "中央大街")
bed = Bed(11, "席梦思")

home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
home.append(bed)
